package com.qiaoba.module.log.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * 使用日志 sys_use_log
 *
 * @author ailanyin
 * @version 1.0
 * @date 1/31/23 4:23 PM
 */
@Getter
@Setter
@TableName("sys_log")
public class SysLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    @Excel(name = "操作序号", width = 25)
    @Schema(description = "操作序号")
    private String id;

    @Excel(name = "操作模块", width = 20)
    @Schema(description = "")
    private String title;

    @Excel(name = "业务类型", replace = {"其他_0", "新增_1", "修改_2", "删除_3", "授权_4", "导出_5", "导入_6", "强退_7", "生成代码_8", "清空数据_9"})
    @Schema(description = "业务类型")
    private Integer businessType;

    @Excel(name = "请求方法", width = 25)
    @Schema(description = "请求方法")
    private String method;

    @Excel(name = "请求方式")
    @Schema(description = "请求方式")
    private String requestMethod;

    @Excel(name = "操作类别", replace = {"其他_0", "后台用户_1", "手机端用户_2"})
    @Schema(description = "操作类别")
    private Integer operatorType;

    @Excel(name = "操作人员")
    @Schema(description = "操作人员")
    private String operatorName;

    @Excel(name = "请求地址", width = 25)
    @Schema(description = "请求地址")
    private String url;

    @Excel(name = "IP地址", width = 20)
    @Schema(description = "IP地址")
    private String ip;

    @Excel(name = "操作地点", width = 15)
    @Schema(description = "操作地点")
    private String operationLocation;

    @Excel(name = "请求参数")
    @Schema(description = "请求参数")
    private String operationParam;

    @Excel(name = "返回参数")
    @Schema(description = "返回参数")
    private String jsonResult;

    @Excel(name = "状态", replace = {"正常_1", "异常_0"})
    @Schema(description = "状态")
    private String status;

    @Excel(name = "错误消息")
    @Schema(description = "错误消息")
    private String errorMsg;

    @Excel(name = "操作时间", format = "yyyy-MM-dd HH:mm:ss", width = 30)
    @Schema(description = "操作时间")
    private Date operationTime;

    @Excel(name = "消耗时间", suffix = "毫秒")
    @Schema(description = "消耗时间")
    private Long costTime;

}
